package com.panda.mall.common.mallElastic.feign;

import com.panda.mall.common.constants.ServicesName;
import com.panda.mall.common.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


/**
 * author: tcy
 * createDate: 2023/2/3
 * description:ES的feign调用
 */
@FeignClient(value = ServicesName.MALL_ELASTIC,fallbackFactory = ElasticFallbackFactory.class)
public interface ElasticFeign {

    @ApiOperation(value = "创建文档", notes = "创建文档")
    @GetMapping("/elastic/addDocument/{id}/{index}")
    Result<String> addDocument(@PathVariable("id") Long id, @PathVariable("index") String index);

    @ApiOperation(value = "修改文档", notes = "修改文档")
    @GetMapping("/elastic/updateDocument/{id}/{eid}/{index}")
    Result<String> updateDocument(@PathVariable("id") Long id,@PathVariable("eid") String eid, @PathVariable("index") String index);
}
